
from pcaspy import Driver, SimpleServer


class myDriver(Driver):

    def __init__(self):

        super(myDriver, self).__init__()


def run_pv_publish(pv_dict: dict):

    pvdb1 = {pvname: {"type": "float", "unit": "uGy/h"}
             for pvname in pv_dict.values()}

    server = SimpleServer()

    server.createPV(prefix="", pvdb=pvdb1)

    driver = myDriver()
    print("IOC Server is runing")
    while True:

        server.process(0.5)


# if __name__ == '__main__':
#     main(pv_dict={"123": "北墙"})
